<!DOCTYPE html>
<html lang="en">
    <head>
		<meta charset="UTF-8">
		<title>编辑页面</title>
		<link rel="stylesheet" href="__ADMIN_PATH__/component/pear/css/pear.css" />
	</head>
	<body>
		<form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">

					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>白天起步价</label>
						<div class="layui-input-block">
							<input type="text" name="start_price_b" autocomplete="off" placeholder="请输入白天起步价" class="layui-input" value="{$info['start_price_b'] ?= $info['start_price_b']}" />
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>夜间起步价</label>
						<div class="layui-input-block">
							<input type="text" name="end_price_y" autocomplete="off" placeholder="请输入夜间起步价" class="layui-input" value="{$info['end_price_y'] ?= $info['end_price_y']}" />
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>白天每公里单价</label>
						<div class="layui-input-block">
							<input type="text" name="distance_price_b" autocomplete="off" placeholder="请输入白天每公里单价" class="layui-input" value="{$info['distance_price_b'] ?= $info['distance_price_b']}" />
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>晚上每公里单价</label>
						<div class="layui-input-block">
							<input type="text" name="distance_price_y" autocomplete="off" placeholder="请输入晚上每公里单价" class="layui-input" value="{$info['distance_price_y'] ?= $info['distance_price_y']}" />
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>起步距离</label>
						<div class="layui-input-block">
							<input type="text" name="start_distance" autocomplete="off" placeholder="请输入起步距离" class="layui-input" value="{$info['start_distance'] ?= $info['start_distance']}" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>白天开始小时数</label>
						<div class="layui-input-block">
							<input type="number" name="h1" autocomplete="off" placeholder="请输入" class="layui-input" value="{$info['h1'] ?= $info['h1']}" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><font color="red">*</font>白天结束小时数</label>
						<div class="layui-input-block">
							<input type="number" name="h2" autocomplete="off" placeholder="请输入" class="layui-input" value="{$info['h2'] ?= $info['h2']}" />
						</div>
					</div>



				</div>
			</div>

			<div class="bottom">
				<div class="button-container">
					<input type="hidden" name="id" value="{$info['id'] ?= $info['id']}" />
					<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
						lay-filter="service">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="pear-btn pear-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>

		</form>
		<script src="__ADMIN_PATH__/component/layui/layui.js"></script>
		<script src="__ADMIN_PATH__/component/pear/pear.js"></script>
		<script>
			layui.use(['form', 'jquery', 'popup', 'loading'], function() {
				let form = layui.form;
				let $ = layui.jquery;
				var popup = layui.popup;
				let loading = layui.loading;

				/**
				 * 表单提交
				 */
				form.on('submit(service)', function(data) {
					$.ajax({
						url:"{:url('chefei/save')}",
						type:"POST",
						dataType:"JSON",
						data:data.field,
						beforeSend: function () {
							loading.Load(1, "");
		                },
		                complete: function () {
		                	loading.loadRemove();
		                },
		                success:function(res)
		                {
		                	if(res.code == 0)
		                	{
		                		//正常业务
		                		popup.success(res.msg, function(){
		                			var index = parent.layer.getFrameIndex(window.name);
		                			parent.location.reload();
		                			parent.layer.close(index); //再执行关闭
	                        	});
		                	}else
		                	{
		                		//业务异常
		                		popup.warning(res.msg);
		                	}
		                },
		                error:function()
		                {
		                	loading.loadRemove();
		                	popup.failure('服务器错误');
		                }
		            });
		            return false;
		        });
		    });
		</script>
		<style type="text/css">
			.plug-file-upload-view li
			{
				display: inline;
			}
		</style>
		{include file="publics/ueditor" /}
		<!--编辑器事件必须放到ueditor下面-->
		<script type="text/javascript">
			var editor = UE.getEditor('editor-tag-introduce',{
		    	initialFrameWidth:'100%',
		    	initialFrameHeight:350,
		    	autoFloatEnabled:false,
		    	autoHeightEnabled:false,
		    	serverUrl:"{:url('ueditor/index',['path_type' => !empty($editor_path_type) ? $editor_path_type : 'common'])}"
		    });
		    var editor2 = UE.getEditor('editor-tag-taboos',{
		    	initialFrameWidth:'100%',
		    	initialFrameHeight:350,
		    	autoFloatEnabled:false,
		    	autoHeightEnabled:false,
		    	serverUrl:"{:url('ueditor/index',['path_type' => !empty($editor_path_type) ? $editor_path_type : 'common'])}"
		    });
		    var editor3 = UE.getEditor('editor-tag-notice',{
		    	initialFrameWidth:'100%',
		    	initialFrameHeight:350,
		    	autoFloatEnabled:false,
		    	autoHeightEnabled:false,
		    	serverUrl:"{:url('ueditor/index',['path_type' => !empty($editor_path_type) ? $editor_path_type : 'common'])}"
		    });
		</script>
	</body>
</html>